//
//  OusideBleDiscovery.h
//
//
//  Created by  on 2024/4/18.


#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>
#import "CABLeService.h"
#import "CARingSDK.h"



@interface OusideBleDiscovery : NSObject

@property (nonatomic, weak) id<CABleScanProtocal>       scanDelegate;
@property (nonatomic, weak) id<CABleDataProtocal>       dataDelegate;



@property (retain, nonatomic) NSMutableArray<CABLeService *>    *foundPeripherals;//发现设备
@property(strong, atomic, readonly)CABLeService *currentService; //当前正在处理中的外设
@property (nonatomic) BOOL isRefreahing;



- (CBManagerState)deviceBleCenterState;

- (void) startScanning;//Start Scan
- (void) stopScanning;//Stop Scanning
- (void)cancelAllReconnect;//Cancel reconnection

- (void) connectPeripheral:(CABLeService*)keyService;//Connect peripherals For users to select devices from a list
- (void) disconnectPeripheral:(CABLeService*)keyService;//Manually disconnect peripherals

- (void) retrievePeripheral:(NSString *)uuid;//Reconnect peripherals





- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
+ (instancetype)instance;

@end
